<?php

// print_r($_GET['keys']);die;

if(!empty($_GET['keys'])){
// echo 1;die;
	$keys = $_GET['keys'];
// print_r(1);die;
	$ative = getSelectByOne('ative',"keys_id='$keys'");

	// echo 7;die;

	if(time()<$ative['cookie_time']){
           // echo 1;die;
		$rows = edit('menber',$ative['menber_id'],array('ative'=>1));

		// echo 8;die;
	// print_r($rows);die;
		

		if($rows>0){
			// echo 1;die;
			echo '<script> alert ("帐号激活成功，点击确定后将跳转到登录页面");location.href="http://127.0.0.1/cms/index.php?c=index&a=index";</script>';die;
	}	

	}else{
		echo '<script> alert ("链接已经失效，请重新申请");</script>';die;
	}
  
}
// if(!empty($_POST)){
// 	if($_POST['password']!=$_POST['cpassword']){

// 		echo '<script> alert ("原密码与验证的密码不相符");history.go(-1);</script>';die;
// 	}

// 	$_POST['password']=md5($_POST['password']);

//     unset($_POST['cpassword']);

// 	$rows = add('menber',$_POST);

	

// 	if ($rows>0) {

// 		include(LIB_PATH.'sen_mail.php');
// 		sen_email($_POST['email']);
		
//     echo '<script> alert ("注册成功，请到邮箱中激活您的账号");location.href="index.php?c=index&a=index";</script>';die;
       
// }else{

//     echo '<script> alert ("注册失败");history.go(-1);</script>';
//         die;
// }
// }




// print_r($_SESSION);die;

// include ('protected/view/home/index/index.html');

// print_r(VIEW_PATH);die;
// include (VIEW_PATH.$admin.'layout.html');
?>

